package com.mjlf.aspect;

import com.mjlf.aspect.aopt.UAspect;
import com.mjlf.aspect.config.Config;
import com.mjlf.aspect.entity.AbstractUser;
import com.mjlf.aspect.entity.User;
import com.mjlf.aspect.entity.UserDao;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import sun.misc.ProxyGenerator;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Proxy;

/**
 * @ClassName Test
 * @Author mjlft
 * @Date 2019/6/29 12:23
 * @Version 1.0
 * @Description TODO
 */
public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext =
                new AnnotationConfigApplicationContext(Config.class);
//        GenericXmlApplicationContext annotationConfigApplicationContext = new GenericXmlApplicationContext("classpath:spring.xml");
        AbstractUser user =  (User)annotationConfigApplicationContext.getBean(User.class);
        user.checkName();

        AbstractUser user1 =  (User)annotationConfigApplicationContext.getBean(User.class);
        user1.checkName();

//        System.out.println("-----" + user.hashCode());
//        System.out.println("-----" + user1.hashCode());
    }
}
